using NetByDocker;
using NetByDocker.Extensions;

/*
项目说明
1.简单的操作数据库，连接数据库，docker部署
2.使用EFCore + linq进行表关联操作数据库等
 */

var builder = WebApplication.CreateBuilder(args);

builder.AddServiceDefaults();

var startup = new Startup(builder.Configuration, builder.Environment);

// 注册服务
startup.RegisterServices(builder.Services);
var app = builder.Build();

app.MapDefaultEndpoints();

var connType = builder.Configuration["DbConfig:EnabledDb"];
if (connType != "Memory")
    await app.InitDataAsync();

//使用中间件
startup.SetupMiddlewares(app, app.Environment);

app.Run();

/// <summary>
/// 集成测试引用使用
/// </summary>
public partial class Program { }